package com.shwread.android.qysw.activity.healthy;

import android.app.Activity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.shwread.android.qysw.step.adapter.AllDataAdapter;
import com.shwread.android.qysw.step.dto.DaysStepDto;
import com.shwread.android.qysw.step.model.UserHealthyDataModel;
import com.shwread.android.qysw.step.view.LoadMoreListView;
import com.shwread.android.qysw10000136.R;

import java.util.List;
import java.util.Map;

import butterknife.ButterKnife;
import butterknife.InjectView;

/**
 * Created by Fantasy on 16/4/28.
 */
public class AllDatasActivity extends Activity {
    @InjectView(R.id.back_btn)
    ImageView backBtn;
    @InjectView(R.id.back_text)
    TextView backText;
    @InjectView(R.id.title_text)
    TextView titleText;
    @InjectView(R.id.right_text)
    TextView rightText;
    @InjectView(R.id.right_img)
    ImageView rightImg;
    @InjectView(R.id.all_data_list_view)
    LoadMoreListView allDataListView;
    private LinearLayoutManager linearLayoutManager;
    AllDataAdapter allDataAdapter;

    List<DaysStepDto> datas;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.h_all_datas_activity);
        ButterKnife.inject(this);
        titleText.setText("数据汇总");
        backBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        datas = UserHealthyDataModel.getInstance().getAllDatas();
        linearLayoutManager = new LinearLayoutManager(this);
        allDataListView.setLayoutManager(linearLayoutManager);

        allDataAdapter = new AllDataAdapter(this);
        allDataAdapter.init_data_list(datas);
        allDataListView.setAdapter(allDataAdapter);
    }
}
